package com.danciyixue.boot.dcyx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.danciyixue.boot.dcyx.model.entity.UserCurrentUnits;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.danciyixue.boot.dcyx.model.entity.Programs;
import com.danciyixue.boot.dcyx.model.entity.UserCurrentUnits;
import com.danciyixue.boot.dcyx.model.query.UserCurrentUnitsQuery;
import com.danciyixue.boot.dcyx.model.vo.UserCurrentUnitsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户当前选择单元信息Mapper接口
 *
 * @author youlaitech
 * @since 2025-06-15 16:36
 */
@Mapper
public interface UserCurrentUnitsMapper extends BaseMapper<UserCurrentUnits> {

    /**
     * 获取用户当前选择单元信息分页数据
     *
     * @param page 分页对象
     * @param queryParams 查询参数
     * @return {@link Page<UserCurrentUnitsVO>} 用户当前选择单元信息分页列表
     */
    Page<UserCurrentUnitsVO> getUserCurrentUnitsPage(Page<UserCurrentUnitsVO> page, @Param("queryParams") UserCurrentUnitsQuery queryParams);

    /**
     * 根据ID查询教材信息
     *
     * @param programId 教材ID
     * @return 教材信息
     */
    @Select("SELECT * FROM dcyx_programs WHERE id = #{programId}")
    Programs selectProgramById(@Param("programId") Long programId);
}
